package com.miyake.server.dsaccess;

import javax.jdo.PersistenceManager;

import com.miyake.server.DsNode;
import com.miyake.server.PMF;

public class CreateNode {

	public DsNode create(String parentKey, String name, Integer type) {
		PersistenceManager pm = PMF.get().getPersistenceManager();
		DsNode ret = null;
		try {
			ret = new DsNode(parentKey, name, type);
			update(ret);
			pm.makePersistent(ret);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			pm.close();
		}
		return ret;
	}

	protected void update(DsNode dsNode) {}
}
